package be.kdg.netpresentadmin;

import java.util.EventObject;

/**
* Event casted when there is a question answered in the QnaPanel that needs 
* to be handled by the AdminGUI. this event contains the answer and the ID
* of the question 
*
* @autor Timothy Huber, Joris Clevenbergs, Rik verschuren, Wim Van der Wilt
*/
public class QuestionAnsweredEvent extends EventObject {

	/**
	 * Default version ID
	 */
	private static final long serialVersionUID = 1L;
	
	private String sAnswer;
	private int iQuestionId;

	/**
	* Constructor for the QuestionAnsweredEvent class.
	* 
	* @param source 	Object that casted this event.
	* @param questionId	Integer representing the id of the answered question.
	* @param answer		String which contains the answer.
	*/
	public QuestionAnsweredEvent(Object source,int questionId, String answer) {
		super(source);
		this.iQuestionId = questionId;
		this.sAnswer = answer;
	}

	/**
	* Method to return a string containing the answer.  
	*/
	public String getAnswer() {
		return this.sAnswer;
	}
	
	/**
	* Method to return an integer representing the ID of the answered question.  
	*/
	public int getQuestionId(){
		return this.iQuestionId;
	}
}
